import instance from '@/utils/request.js'

export function getDepartmentApi() {
    return instance({
        url: '/company/department'
    })
}
export function delDepartmentApi(id) {
    return instance({
        url: `/company/department/${id}`,
        method: 'Delete'
    })
}
export function addDepartmentApi(data) {
    return instance({
        url: '/company/department',
        method: 'POST',
        data
    })
}

export function getDepartmentByIdApi(id) {
    return instance({
        url: `/company/department/${id}`
    })
}
// 根据 id 修改部门信息
export function editDepartmentByIdApi(data) {
    return instance({
        url: `/company/department/${data.id}`,
        method: 'PUT',
        data
    })
}